
<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>


<script>
    $(function () {
        $("#userloglist").datagrid({
            url:"${pageContext.request.contextPath}/getLogs",
            pagination:true,
            toolbar:"#tblogbtn",
            columns:[[
                {field:'logId',title:'ID',width:100},
                {field:'logContent',title:'CONTENT',width:100},
                {field:'adminName',title:'ADMIN-NAME',width:100},
                {field:'logDate',title:'LOG-DATE',width:100,align:'right'},
                {field:'logIp',title:'IP-ADDRESS',width:100,align:'right'},
            ]]
        });


    })



    function deletelog(){
        var selecked=$("#userloglist").datagrid("getSelections");
        if(selecked.length==0){
            $.messager.alert('我的消息','请选中你要删除的日志！','info');
        }else{
            $.messager.confirm('确认对话框', '您确定要删除选中日志吗？', function(r){
                if (r){
                    var ids=new Array();
                    for(var i=0;i<selecked.length;i++){
                        ids[i]=selecked[i].logId;
                    }
                    $.ajax({
                        url:"${pageContext.request.contextPath}/deleteLogs",
                        data:{"ids":ids},
                        type:"post",
                        traditional:true,
                        success:function (data) {
                            $.messager.alert('我的消息',data.message,'info');
                            $("#userloglist").datagrid("reload");
                        }
                    });
                }
            });
        }
    }





</script>


<table id="userloglist"></table>

<div id="tblogbtn">
    <a href="javascript:deletelog()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">删除选中</a>
</div>

